   var feedData={};
 
  function makeActivityFromEntryIndex(i){
    var entry = feedData.responseData.feed.entries[i];
    makeActivity(entry);
  }
  function makeActivity(entry) {
       var activity = opensocial.newActivity({title: '<a href="'+entry.link+'">'+entry.title+'</a>', url: entry.link, body: entry.contentSnippet});
       opensocial.requestCreateActivity(activity, "HIGH");
  }

    function showfeed(result,maxItems,fullContent) {
      var container = document.getElementById("feed");
      if (result.responseStatus == 200) {
        feedData=result;
        var heading =  document.getElementById("feed-title");
        heading.innerHTML=result.responseData.feed.title;
        var html= new Array();
        html.push('<ul class="hfeed">');
        for (var i = 0; i < maxItems; i++) {
          var entry = result.responseData.feed.entries[i];
          html.push('<li class="hentry" id="entry-'+i+'" >'); 
          html.push('<a rel="bookmark" href="' + entry["link"] +'"  target="_new" onclick="makeActivityFromEntryIndex('+i+');return true;"><h3 class="entry-title">')
          html.push(entry["title"]);
          html.push('</h3></a>')
          if (fullContent==1) {
            html.push('<p class="entry-content">');
            html.push(entry["content"]);
          } else {
            html.push('<p class="entry-summary">');
            html.push(entry["contentSnippet"]);
          }
          html.push('</p></li>');
        }
        html.push('</ul>');
       container.innerHTML = html.join("");
      }
      else {
        var div = document.createElement("div");
        div.appendChild(document.createTextNode(result.responseDetails));
        container.appendChild(div);
      }
    gadgets.window.adjustHeight();
    }

